package unit11.extractSuperclass.ori;

import java.util.ArrayList;
import java.util.List;

/**
 * @author v_irlwang
 * @date 2021/5/24
 */
public class Department {

    private String name;
    private List<Employee> staff = new ArrayList<>();

    public Department(String name) {
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public int getHeadCount() {
        return staff.size();
    }


    public int getTotalAnnualCost(){
        int result = 0;
        for (Employee employee : staff) {
            result += employee.getAnnualCost();
        }
        return result;
    }


}
